package com.hiwan.system.service.login;

import java.util.List;

import org.springframework.stereotype.Service;

import com.hiwan.system.common.base.GenericService;
import com.hiwan.system.dao.login.LoginDao;
import com.hiwan.system.pojo.LoginInfo;
import com.hiwan.system.pojo.LoginfoStatistics;

@Service
public class LoginfoService extends GenericService<LoginDao, LoginInfo, String>{

	/**
	 * 查询曾经登陆过的用户登录信息
	 * @param userId 用户id
	 * @param startTime 和endTime组成时间区间YYYYMMDDhhmiss
	 * @param endTime
	 * @return
	 */
	public List<LoginInfo> listLoginedUsers(String userId, String startTime, String endTime){
		return dao.selectLoginedUsersList(userId, startTime, endTime);
	}	
	
	public List<LoginfoStatistics> countLoginfoByOrg(String startTime, String endTime, String orgId){
		return dao.selectCountLoginfoByOrgList(startTime, endTime, orgId);
	}

	public List<LoginfoStatistics> countLoginfoByUser(String startTime, String endTime, String orgId) {
		return dao.countLoginfoByUser(startTime, endTime, orgId);
	}
}
